#include <rtthread.h>
#include "lfs_if.h"
static void ls(int argc, char**argv)
{
  lfs_dir_t *dir;
  struct lfs_info info;
  dir = dir_open("");
  if(dir == NULL) {
    rt_kprintf("No such file or directory.\n");
    return;
  }
  while(dir_read(dir, &info) > 0) {
    printf("type: %s name: %s size: %ld Bytes\n", 
    info.type==LFS_TYPE_REG?"LFS_TYPE_REG":"LFS_TYPE_DIR", info.name, info.size);
  }
  dir_close(dir);
  return;
}
MSH_CMD_EXPORT(ls, show the list of files in the current dir);
